package com.dingyuhang.controller;


import com.dingyuhang.bean.Forum;
import com.dingyuhang.service.ForumService;

import com.dingyuhang.util.MyAnn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 版块
 *
 *
 */
@Controller
public class ForumController {
	
	@Autowired
	private ForumService forumService;
	/**
	 * 首页板块
	 * @param modle
	 * @return
	 */



	@RequestMapping({"","/","/index"})
	public String index(Model modle) {
		List<Forum> forums = forumService.selectForums();//查询所有的板块
		modle.addAttribute("forums", forums);
		return "index";
	}
	

}
